package com.example.yang_android_app_eighth;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.MediaController;
import android.widget.VideoView;

import androidx.appcompat.app.AppCompatActivity;

import java.io.File;


public class MainActivity extends AppCompatActivity {
    VideoView videoView;
    EditText editText;
    MediaController mController;
    Button button;
   @Override
    protected void onCreate(Bundle savedInstanceState)
   {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        videoView=findViewById(R.id.video);
        button=findViewById(R.id.button);
       editText=findViewById(R.id.edit);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String url=editText.getText().toString();
                Intent intent = new Intent(MainActivity.this,play.class);
                intent.putExtra("url", url);
                startActivity(intent);
            }
        });



   }

}

